package com.c.ctgproject.ui.production.pre

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.CTGproject
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.entity.ResultEntity
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.*

class PreProductionViewModel : BaseViewModel() {
    private val _scanQR = MutableLiveData<String>()
    val scanQR: LiveData<String> get() = _scanQR


    fun scanQR(carCode: String, warehouseId: String, weightBeforeDis: String) {
        launch({
            _scanQR.value = ApiMethods.getApiService().movWarehouse(userToken, carCode, warehouseId, weightBeforeDis).awaitSync()
        }, {
            mError.value=it.message.handlerNull()
        })
    }
}